teach (someone) a lesson

Translations
donner une leçon à quelqu’un
Definitions
To give someone a lesson or experience that serves as a warning or a way to correct their behavior, often by demonstrating the consequences of their actions.